package com.woniuxy.utils;

import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;

/**
 * Created by xxhcm on 2021/3/24.
 */
public class MailUtil {
    public static void SendMail(String account,JavaMailSender mailSender){
        SimpleMailMessage message = new SimpleMailMessage();
        message.setFrom("1711457876@qq.com");
        message.setTo(account);
        message.setSubject("主题：通知邮件");
        message.setText("你已经成功注册");

        mailSender.send(message);

    }

    public static void sendCode(String account,JavaMailSender mailSender,String content){
        SimpleMailMessage message = new SimpleMailMessage();
        message.setFrom("1711457876@qq.com");
        message.setTo(account);
        message.setSubject("主题：通知邮件");
        message.setText(content);
        

        mailSender.send(message);
    }
}
